<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:t="http://myfaces.apache.org/tomahawk"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:s="http://myfaces.apache.org/sandbox"
                xmlns:jwork="http://irian.at/jsfatwork"
        >

    <s:pprPanelGroup id="dataList" rendered="#{bean.entities != null}" partialTriggers="edit,savedit,canceledit,showall,showrecent,#{partialTriggers}">
        <t:dataTable var="entity" value="#{bean.entities}" styleClass="jsfatwork" style="width:500px;">
            <t:column rendered="#{entity.id ne bean.entity.id}">
                <div style="font-size:12px;font-weight:bold;">
                        <h:commandLink id="edit" value="#{entity[editProperty]}">
                            <f:setPropertyActionListener target="#{bean.entity}" value="#{entity}" />
                            <s:pprSubmit />
                        </h:commandLink>
                        &#160;&#160;&#160;
                        <h:commandLink value="Edit multiple steps" action="/task1.xhtml" rendered="#{editMultipleSteps}">
                            <f:setPropertyActionListener target="#{bean.entity}" value="#{entity}" />
                        </h:commandLink>
                </div>
                <div style="font-size:10px;padding-top:5px;padding-bottom:3px;">
                    <h:outputText value="#{entity[contentProperty]}" />
                    <ui:insert name="additionalInfo" />
                </div>
            </t:column>
            <t:column style="padding:4px;" rendered="#{entity.id eq bean.entity.id}">
                <h:panelGrid columns="3" styleClass="grid">

                    <h:inputHidden id="error" />
                    <h:message for="error" styleClass="warning" />
                    <h:panelGroup />

                    <ui:insert name="inputFields" />
                    <h:panelGroup />
                    <h:panelGrid columns="2">
                        <h:panelGroup>
                            <jwork:buttonSave id="savedit" pprSubmit="true" />
                        </h:panelGroup>
                        <h:panelGroup>
                            <jwork:buttonCancel id="canceledit" pprSubmit="true" />
                        </h:panelGroup>
                    </h:panelGrid>
                    <h:panelGroup />
                </h:panelGrid>
            </t:column>
            <t:column rendered="#{entity.id ne bean.entity.id}">
                <div style="font-size:12px;font-weight:bold;width:100%;right:10px;text-align:right;">
                    <h:commandLink id="delete" value="delete" action="#{bean.delete}">
                        <f:setPropertyActionListener target="#{bean.entity}" value="#{entity}" />
                        <s:pprSubmit />
                    </h:commandLink>
                </div>
            </t:column>
        </t:dataTable>
        <div style="width:500px;text-align:right">
            <h:commandLink id="showall" value="Show all" action="#{bean['toggleShowAll']}" rendered="#{!bean.showAll}"  immediate="true" >
                <s:pprSubmit />
            </h:commandLink>

            <h:commandLink id="showrecent" value="Show most recent" action="#{bean['toggleShowAll']}" rendered="#{bean.showAll}"  immediate="true" >
                <s:pprSubmit />
            </h:commandLink>
        </div>
    </s:pprPanelGroup>

</ui:composition>
